@import (once) "../../include/vars";
@import (once) "../../include/mixins";

:root {
    --windows-shortcut-icon-size: 40px;
    --windows-shortcut-border-radius: 4px;
    --windows-shortcut-background: transparent;
    --windows-shortcut-background-hover: #efefef;
    --windows-shortcut-color: #191919;
    
    --shortcut-border-radius: 6px;
    --shortcut-background: #f8f8f8;
    --shortcut-color: #191919;
    --shortcut-background-hover: #dadada;
    --shortcut-color-hover: #474747;
}

.dark-side {
    --windows-shortcut-background: transparent;
    --windows-shortcut-background-hover: #373737;
    --windows-shortcut-color: #F8F8F8;

    --shortcut-background: #2e2e2e;
    --shortcut-color: #F8F8F8;
    --shortcut-background-hover: #373737;
    --shortcut-color-hover: #bfbfbf;
}

.shortcut {
    width: 84px;
    height: 84px;
    display: inline-flex;
    flex-direction: column;
    font-size: .9rem;
    transition: @transition-base;
    background: var(--shortcut-background);
    color: var(--shortcut-color);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    border: 1px solid transparent;
    position: relative;
    align-items: center;
    justify-content: center;
    outline: none;
    border-radius: var(--shortcut-border-radius);
    gap: 8px;

    .icon, .caption {
        display: block;
        line-height: 1;
    }

    .icon {
        display: block;
        vertical-align: middle;
        width: 28px;
        height: 28px;
        font-size: 28px;
        order: 1;
        margin-top: 10px;
    }

    .caption {
        color: inherit;
        order: 2;
        font-size: 12px;
    }

    .badge {
        position: absolute;
        .px2rem(font-size, 11px);
        top: .25rem;
        right: .25rem;
        color: inherit;
        transform: none;
        background-color: inherit;
    }

    @media (hover: hover) {
        &:hover {
            background: var(--shortcut-background-hover);
            color: var(--shortcut-color-hover);
        }
    }
    
    @media (hover: none) {
        &:active {
            background: var(--shortcut-background-hover);
            color: var(--shortcut-color-hover);
        }
    }

    &.focus, &:focus {
        .focus-show(@light-gray);
    }

    &.outline {
        background: transparent none;
        border-width: 1px;
        border-color: var(--border-color);
        &:hover {
            background: var(--shortcut-background-hover);
            color: var(--shortcut-color-hover);
        }
    }

    &:focus, &:hover, &:active {
        text-decoration: none;
    }

    &:active {
        outline: 0;
        .focus-show(@gray);
    }

    &.disabled, &:disabled {
        opacity: .65;
    }

    &:active {
        box-shadow: none;
    }
}

.shortcut:not(:has(.caption)) {
    .icon {
        width: 32px;
        height: 32px;
        font-size: 32px;
        margin-top: 0;
    }
}

.windows-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    cursor: default;
    border-radius: 4px;
    padding: 4px;
    background: var(--windows-shortcut-background);
    color: var(--windows-shortcut-color);
    
    .icon {
        width: var(--windows-shortcut-icon-size);
        height: var(--windows-shortcut-icon-size);
        font-size: var(--windows-shortcut-icon-size);
        object-fit: cover;
    }
    
    .caption {
        font-size: 12px;
        text-align: center;
    }
    
    @media (hover: hover) {
        &:hover {
            background: var(--windows-shortcut-background-hover);
        }
    }
    
    @media (hover: none) {
        &:active {
            background: var(--windows-shortcut-background-hover);
        }
    }   
}